package com.kuang.org.service;

import com.kuang.bascic.service.BaseServiceImpl;
import com.kuang.bascic.utils.PageList;
import com.kuang.org.domain.Department;
import com.kuang.org.domain.Employee;
import com.kuang.org.mapper.EmployeeMapper;
import com.kuang.org.query.EmployeeQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class EmployeeServiceImpl implements EmployeeService {
    @Autowired
    private EmployeeMapper employeeMapper;
    @Override
    public List<Employee> selectAllEmployee() {
        return employeeMapper.selectAllEmployee();
    }

    @Override
    public Employee selectEmployeeById(Long id) {

        return employeeMapper.selectEmployeeById(id);
    }

    @Override
    public void UpdateEmployee(Employee employee) {
        employeeMapper.UpdateEmployee(employee);
    }

    @Override
    public void addEmployee(Employee employee) {
        employeeMapper.addEmployee(employee);
    }

    @Override
    public void deleteEmployeeById(Long id) {
        employeeMapper.deleteEmployeeById(id);
    }
//分页查新
    @Override
    public List<Employee> selectByPage(EmployeeQuery employeeQuery) {
        //传入查询分页信息并设置
        List<Employee> employees = employeeMapper.selectByPage(employeeQuery);
        return employees;

    }

    @Override
    public Long selectCountAll(EmployeeQuery employeeQuery) {

        return employeeMapper.selectCountAll(employeeQuery);
    }

    @Override
    public void PatchDelete(List<Long> id) {
        employeeMapper.PatchDelete(id);
    }
}
